package components {
import flash.events.EventDispatcher;
import flash.geom.Point;

import geditor.common.AlignInformation;
import geditor.common.DrawPoint;
import geditor.events.ChangeEvent;

/**
 * Simple point. Can not be aligned to any other object. Can be on any place
 */
public class SimplePoint extends EventDispatcher implements DrawPoint {
    private var p:Point;

    public function SimplePoint() {
    }

    public function get point():Point {
        return p;
    }

    public function get initialised():Boolean {
        return p != null;
    }

    public function canAlign(obj:Object):AlignInformation {
        return null;
    }

    public function doAlign(align:Object):void {
        throw new Error("Align unsupported for this point");
    }

    public function set temp(value:Point):void {
        if (value != null) {
            p = value;
            dispatchEvent(new ChangeEvent());
        }
    }

    public function get isTemp():Boolean {
        return false;
    }
}
}